/*
 * @Date: 2023-01-07 08:56:00
 * @LastEditors: 许成志 18296777223@163.com
 * @LastEditTime: 2023-01-09 08:50:46
 */


export function replaceFun(regexp, target, resource){
    let str = target.replace(regexp, resource)
    return str
}

/**
 * @description: 封装replace方法,形参为string
 * @param {RegExp} regexp 正则表达式
 * @param {String} target 替换目标对象
 * @param {String} resource 用来替换的替换值
 * @return {String} 被替换后的字符窜，原字符串不会改变
 */
export function replaceStr(regexp, target, resource){
    let str = target.replace(regexp, (resource)=>{
        return resource
    })
}